package com.mon4cc.simulation;

import org.jbpt.pm.FlowNode;
import org.jbpt.pm.bpmn.Bpmn;
import org.jbpt.pm.bpmn.BpmnControlFlow;

import java.util.Map;
import java.util.Set;


/**
 * @author Ping
 * @date 2022/12/19 11:30
 **/
public interface BPMNExecution {
    public static final String INACTIVATED = "inactivated" ;
    public static final String RUNING = "running" ;
    public static final String FINISHED = "finished" ;
    public static final String ERROR = "error" ;

    public Bpmn<BpmnControlFlow<FlowNode>, FlowNode> getBpmn() ;
    public void execute(ExecuteContext context) ;
    public void multiExecute(ExecuteContext context, int excuteTime) ;
    public boolean finished() ;
    public void setState(String state) ;
    public void stopExecution(ExecuteContext context) ;
    public FlowNode getStartEvent() ;
    public FlowNode getEndEvent() ;
    /**
     * generate simulated values for written data objects from {@code flowNode}
     * @param flowNode
     * @return
     */
    public Map<String, Object> getSimulatedValueForDataObject(FlowNode flowNode) ;
    public Set<BpmnControlFlow<FlowNode>> getOutputControlflow(FlowNode flowNode) ;
    public Set<BpmnControlFlow<FlowNode>> getInputControlflow(FlowNode flowNode) ;

    public boolean containedInInvalidatedDataAssignementEvents(String instanceName) ;

}
